﻿<UserControl x:Class="BestCode.Creds.UI.VwFieldDefinition"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:controls="clr-namespace:BestCode.Wpf.Controls;assembly=BestCode.Wpf.Controls"
             xmlns:data="clr-namespace:BestCode.Wpf.Controls.Data;assembly=BestCode.Wpf.Controls.Data"
             xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
             mc:Ignorable="d" 
             MinHeight="500" MinWidth="500">
    <Grid>
        <controls:FormHeader TitleText="PERSONS" DescriptionText="Do double click for edit current row Person" Margin="0,0,0,0">
            <Grid Name="grdMain">

                <DataGrid AutoGenerateColumns="False" ItemsSource="{Binding Items,Mode=TwoWay}" Name="grdFieldDefinition"
                  SelectedItem="{Binding SelectedItem,Mode=TwoWay}" Margin="6,101,6,51" IsReadOnly="True" MouseDoubleClick="Control_OnMouseDoubleClick">
                    <DataGrid.Columns>
                        <DataGridTextColumn Header="Code" Binding="{Binding Code}"/>
                        <DataGridTextColumn Header="CI" Binding="{Binding CI}"/>
                        <DataGridTextColumn Header="FirstName" Binding="{Binding FirstName}"/>
                        <DataGridTextColumn Header="SecondName" Binding="{Binding SecondName}"/>
                        <DataGridTextColumn Header="LastName1" Binding="{Binding LastName1}"/>
                        <DataGridTextColumn Header="LastName2" Binding="{Binding LastName2}"/>
                        <DataGridTextColumn Header="Address" Binding="{Binding Address}"/>
                        <DataGridTextColumn Header="AddressZone" Binding="{Binding AddressZone}"/>
                        <DataGridTextColumn Header="WorkPhone" Binding="{Binding WorkPhone}"/>
                        <DataGridTextColumn Header="CellPhone" Binding="{Binding CellPhone}"/>
                        <DataGridTextColumn Header="Picture" Binding="{Binding Picture}"/>
                        <DataGridTextColumn Header="Entity" Binding="{Binding Entity}" Visibility="Hidden"/>
                        <DataGridTextColumn Header="Children" Binding="{Binding EntityChild.Name}"/>
                        <DataGridTemplateColumn Width="55" Header="Enabled">
                            <DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <Grid>
                                        <CheckBox HorizontalAlignment="Center"  IsChecked="{Binding IsEnabled}"/>
                                    </Grid>
                                </DataTemplate>
                            </DataGridTemplateColumn.CellTemplate>
                        </DataGridTemplateColumn>

                    </DataGrid.Columns>
                </DataGrid>


                <controls:ImageButton  TextButton="New"  Margin="0,0,10,10" Height="30" VerticalAlignment="Bottom" HorizontalAlignment="Right" Width="66" Click="ImageButton_Click" ImageSource="Images/add.ico"/>
                <controls:ImageButton Name="btnGenerate"  TextButton="Generate All Credentials"  Margin="0,66,6,0" Height="30" VerticalAlignment="Top" HorizontalAlignment="Right" Width="181" Click="btnGenerate_Click" ImageSource="Images/All.ico"/>
                <Button Margin="10,8,0,0" Content="{Binding OutputFolder}" Name="btnOpenOutputFolder" HorizontalAlignment="Left" Width="226" Height="21" VerticalAlignment="Top" Click="btnOpenOutputFolder_Click"/>
                <Button Margin="10,31,0,0" Content="{Binding PicturesFolder}" x:Name="btnOpenPicturesFolder" HorizontalAlignment="Left" Width="226" Height="21" VerticalAlignment="Top" Click="btnOpenPicturesFolder_Click"/>

                <ComboBox ItemsSource="{Binding VmEntityChild.ChildrenByEntity, Mode=TwoWay}" SelectedItem="{Binding SelectedEntityChild,Mode=TwoWay}" DisplayMemberPath="Name" Margin="0,28,10,0" HorizontalAlignment="Right" Width="221" Height="26" VerticalAlignment="Top"></ComboBox>
                <TextBlock Text="Children of Entity" Margin="0,6,10,0" HorizontalAlignment="Right" Width="127" Height="18" VerticalAlignment="Top" FontWeight="Bold"/>
                <controls:ImageButton x:Name="btnGenerateSelectedItems"  TextButton="Generate Only Selected Items"  Margin="0,66,192,0" Height="30" VerticalAlignment="Top" HorizontalAlignment="Right" Width="209" Click="btnGenerateSelectedItems_Click" ImageSource="Images/Selected.ico"/>
                <controls:ImageButton  TextButton="Delete"  Margin="0,0,90,10" Height="30" VerticalAlignment="Bottom" HorizontalAlignment="Right" Width="75" Name="btnDelete" Click="btnDelete_Click" ImageSource="Images/close.png" />

                <TextBlock Text="TOTAL :" Margin="10,0,0,13" Height="21" VerticalAlignment="Bottom" HorizontalAlignment="Left" Width="60" FontWeight="Bold" FontSize="16"></TextBlock>
                <TextBlock Text="{Binding Total, Mode=TwoWay}" Margin="75,0,0,13" Height="21" VerticalAlignment="Bottom" HorizontalAlignment="Left" Width="60" FontWeight="Bold" FontSize="16"/>
                <TextBlock Text="ENABLEDS :" Margin="212,0,0,13" Height="21" VerticalAlignment="Bottom" HorizontalAlignment="Left" Width="89" FontWeight="Bold" FontSize="16"/>
                <TextBlock Text="{Binding EnabledItemsCount, Mode=TwoWay}" Margin="306,0,0,13" Height="21" VerticalAlignment="Bottom" HorizontalAlignment="Left" Width="60" FontWeight="Bold" FontSize="16"/>

                <ProgressBar Margin="377,0,176,10" Name="pgbar" Height="30" VerticalAlignment="Bottom" Maximum="{Binding EnabledItemsCount, Mode=TwoWay}" />
                <controls:ImageButton x:Name="btnShowEnabledFieldsReport"  TextButton="Print Enabled Fields"  Margin="0,66,412,0" Height="30" VerticalAlignment="Top" HorizontalAlignment="Right" Width="154" Click="BtnShowEnabledFieldsReport_OnClick" ImageSource="Images/usercenter.ico"/>

                <TextBox Name="txtFilter" Margin="57,66,581,0" FontWeight="Bold" FontSize="16" Height="30" VerticalAlignment="Top"></TextBox>
                <TextBlock Text="Filter :" Margin="6,71,0,355" FontSize="16" HorizontalAlignment="Left" Width="46"></TextBlock>
                <!--<xctk:BusyIndicator Name="busyIndicator"  >
                    <xctk:BusyIndicator.BusyContentTemplate>
                        <DataTemplate>
                            <StackPanel Margin="4">
                                <TextBlock Text="Generating......." FontWeight="Bold" HorizontalAlignment="Center"/>
                                <StackPanel Margin="4">
                                    <TextBlock Name="txtProgress"  Text="Generating 4 of 10..."/>
                                    <ProgressBar Value="{Binding ProgressCounter, Mode=TwoWay}" Height="15"/>
                                </StackPanel>
                                
                            </StackPanel>
                        </DataTemplate>
                    </xctk:BusyIndicator.BusyContentTemplate>
                    <xctk:BusyIndicator.OverlayStyle>
                        <Style TargetType="Rectangle">
                            <Setter Property="Fill" Value="LightGray"/>
                        </Style>
                    </xctk:BusyIndicator.OverlayStyle>
                    <xctk:BusyIndicator.ProgressBarStyle>
                        <Style TargetType="ProgressBar">
                            <Setter Property="Visibility" Value="Collapsed"/>
                        </Style>
                    </xctk:BusyIndicator.ProgressBarStyle>
                    
                </xctk:BusyIndicator>-->

            </Grid>

        </controls:FormHeader>
    </Grid>
</UserControl>
